import requests
from config import url, headers_web

class LabHomework:

    def __init__(self):
        self.url = url
        self.headers = headers_web
    @classmethod
    def post_add_and_modify_labhomewoek(cls,url:str,params=None,headers=headers_web,json=None):
        """
        @Summary:接口-添加/修改课后作业
        @Description:云课堂老师端教学内容添加/修改课后作业使用
        :param url: /teachingApi/api/v1/labhomeworks
        :param params: validCode:验证码：&signKey=123123(md5加密)
        :param headers:
        :param json:
        :return:
        """
        url = url + "/teachingApi/api/v1/labhomeworks"

        r = requests.post(url=url,params=params,headers=headers,json=json)

        return r
    @classmethod
    def get_labhomewoek_info(cls,url:str,params=None,headers=headers_web,paramspath=None):
        """
        @Summary:根据课后作业id和学生id（或openId）获取作业状态和列表展示所需信息
        @Description:云课堂web学生端使用
        :param url: /teachingApi/api/v1/labhomeworks/{paramspath}/statusinfo
        :param params:
        :param headers:
        :param paramspath:
        :return:
        """

        url = url + f"/teachingApi/api/v1/labhomeworks/{paramspath}/statusinfo"

        r = requests.get(url=url,params=params,headers=headers)

        return  r

    @classmethod
    def post_labhomewoek_list(cls,url:str,params=None,headers=headers_web,json=None):
        """
        @Summary:获取实验作业列表
        @Description:老师端学生端获取实验作业列表
        :param url:
        :param params:
        :param headers:
        :param json:
        :return:
        """
        url = url + "/teachingApi/api/v1/labhomework"

        r = requests.post(url=url, params=params, headers=headers,json=json)

        return r

    @classmethod
    def post_modify_labhomework_status(cls,url:str,params=None,headers=headers_web,json=None,paramspath=None):
        """
        @Summary:接口-更改课后作业状态（立即开始、立即结束、归档）
        @Description:云课堂老师端教学内容列表中作业状态操作使用
        :param url:
        :param params:
        :param headers:
        :param json:
        :param paramspath:
        :return:
        """

        url = url + f"/teachingApi/api/v1/labhomeworks/{paramspath}/status"

        r = requests.post(url=url, params=params, headers=headers,json=json)

        return r
    @classmethod
    def get_teacher_labhomewoek_status_info(cls,url:str,params=None,headers=headers_web,paramspath=None):
        """
        @Summary:接口-更改课后作业状态（立即开始、立即结束、归档）
        @Description:云课堂老师端教学内容列表中作业状态操作使用
        :param url:
        :param params:
        :param headers:
        :param paramspath:
        :return:
        """

        url = url + f"/teachingApi/api/v1/labhomeworks/student/{paramspath}/statusinfo"

        r = requests.get(url=url, params=params, headers=headers)

        return r
    @classmethod
    def get_student_labhomework_status_info(cls,url:str,params=None,headers=headers_web,paramspath=None):
        """
        @Summary:据课后作业id和学生id（或openId）获取作业状态和列表展示所需信息
        @Description:云课堂web学生端使用
        :param url:
        :param params:
        :param headers:
        :param paramspath:
        :return:
        """

        url = url + f"/teachingApi/api/v1/labhomeworks/student/{paramspath}/statusinfo"

        r = requests.get(url=url, params=params, headers=headers)

        return r

    @classmethod
    def post_submit_labhomework(cls,url:str,params=None,headers=headers_web,json=None):
        """
        @Summary:学生提交作业、重新提交作业
        @Description:云课堂微信小程序学生提交、重新提交作业；学生端提交、重新提交作业使用
        :param url:
        :param params:
        :param headers:
        :param json:
        :return:
        """
        url = url + "/teachingApi/api/v1/labhomeworks/student/answer"

        r = requests.post(url=url, params=params, headers=headers, json=json)

        return r

    @classmethod
    def get_labhomework_details(cls,url:str,params=None,headers=headers_web,paramspath=None):
        """
        @Summary:根据课后作业id和学生id（或openId）查询作业详情
        @Description:云课堂web学生端使用
        :param url:
        :param params:
        :param headers:
        :param paramspath:
        :return:
        """
        url = url + f"/teachingApi/api/v1/labhomeworks/student/{paramspath}"

        r = requests.get(url=url,params=params,headers=headers)
        return r

    @classmethod
    def get_cancorrectedanswers_list(cls,url:str,params=None,headers=headers_web,paramspath=None):
        """
        @Summary:接口-获取老师可以批改的作业列表信息
        @Description:云课堂老师批改作业使用
        :param url:
        :param params:
        :param headers:
        :param paramspath:
        :return:
        """
        url = url + f"/teachingApi/api/v1/labhomeworks/{paramspath}/cancorrectedanswers"

        r = requests.get(url=url,params=params,headers=headers)

        return r

    @classmethod
    def post_repulsestatus_labwork(cls,url:str,params=None,headers=headers_web,homework_id=None,answer_id=None,json=None):
        """
        @Summary:接口-老师打回学生提交作业
        @Description:云课堂老师端打回学生提交作业使用
        :param url:
        :param params:
        :param headers:
        :param homework_id:
        :param answer_id:
        :param json:
        :return:
        """
        url = url + f"/teachingApi/api/v1/labhomeworks/{homework_id}/studentanswers/{answer_id}/repulsestatus"
        r = requests.post(url=url,params=params,headers=headers,json=json)

        return r

    @classmethod
    def get_labwork_(cls,url:str,params=None,headers=headers_web,indicatorId=None):
        """
        @Summary:实验作业量表调取
        @Description:云课堂老师端打回学生提交作业使用
        :param url:
        :param params:
        :param headers:
        :return:
        """

        url = url + f"/teachingApi/api/v1/evaluationIndicators/{indicatorId}"

        r = requests.get(url=url,params=params,headers=headers)
        return r


    @classmethod
    def post_correct_labwork(cls,url:str,params=None,headers=headers_web,paramspath=None,json=None):
        """
        @Summary:接口-老师批改作业
        @Description:云课堂老师端批改作业使用
        :param url:
        :param params:
        :param headers:
        :param id:
        :param json:
        :return:
        """

        url = url + f"/teachingApi/api/v1/labhomeworks/{paramspath}/studentanswers/correction"
        r = requests.post(url=url,headers=headers,params=params,json=json)
        return r

    @classmethod
    def post_del_labwork(cls,url:str,params=None,headers=headers_web,paramspath=None,json=None):
        """
        @Summary:接口-删除课后作业接口
        @Description:云课堂老师端删除作业使用
        :param url:
        :param params:
        :param headers:
        :param paramspath:
        :param json:
        :return:
        """

        url = url + f"/teachingApi/api/v1/labhomeworks/{paramspath}/del"

        r = requests.post(url=url,params=params,headers=headers,json=json)

        return r


    @classmethod
    def get_student_labwork_list(cls,url:str,params=None,headers=headers_web,paramspath=None):
        """
        @Summary:接口-根据作业id查询作业学生提交信息
        @Description:云课堂老师查看作业详情中学生表现使用
        :param url:
        :param params:
        :param headers:
        :param paramspath:
        :return:
        """
        url = url + f"/teachingApi/api/v1/labhomeworks/{paramspath}/studentanswers"
        r = requests.get(url=url,params=params,headers=headers)
        return r

    @classmethod
    def get_labwork_teacher_details(cls,url:str,params=None,headers=headers_web,paramspath=None):
        """
        @Summary:接口-老师根据作业id获取作业详情
        @Description:老师根据作业id获取作业详情（小程序使用）;云课堂老师端-获取已归档作业详情使用
        :param url:
        :param params:
        :param headers:
        :param paramspath:
        :return:
        """
        url = url + f"/teachingApi/api/v1/labhomeworks/teacherhomework/{paramspath}"
        r = requests.get(url=url,headers=headers,params=params)
        return r


    @classmethod
    def post_add_labwork_analysisfile(cls,url:str,params=None,headers=headers_web,paramspath=None,json=None):
        """
        @Summary:接口-新增答案解析
        @Description:老师根据作业id获取作业详情（小程序使用）;云课堂老师端-获取已归档作业详情使用
        :param url:
        :param params:
        :param headers:
        :param paramspath:
        :param json:
        :return:
        """

        url = url + f"/teachingApi/api/v1/labhomeworks/{paramspath}/homeworkanalysisfile"

        r = requests.post(url=url,params=params,headers=headers,json=json)
        return r

    @classmethod
    def post_labwork_extendTime(cls,url:str,params=None,headers=headers_web,json=None):
        """
        @Summary:接口-课后作业延迟接口
        @Description:老云课堂老师端教学内容实验作业使用
        :param url:
        :param params:
        :param headers:
        :param paramspath:
        :param json:
        :return:
        """
        url = url + "/teachingApi/api/v1/labhomeworks/extendTime"
        r = requests.post(url=url,params=params,headers=headers,json=json)
        return r

if __name__ == '__main__':
    pass